<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
     <TITLE>Common Tag Attributes: Language Attributes</TITLE>
     <link rel="stylesheet" type="text/css" href="../../../ss/2.css" id="thecss">
     <script type="text/javascript" src="../../../scripts/csschange.js"></script>
</HEAD>

<BODY onload="readSS()">

<h1 align="center"><span class="pagetitle"><b class="alert">%</b>Language<b class="alert">%</b>
Attributes</span><br><font size=2>= <span class="sitetitle">Index DOT Html</span> 
by <a href="../../../misc/email.htm">Brian Wilson</a> =</font></h1>

<center>
<table border=3 cellpadding=5 cellspacing=0>
<tr>
    <td><font size=2><a href="../../index.html">Main Index</a> |
    <a href="../../tree/htmltree.htm">Element Tree</a> |
    <a href="../../tagindex/a.htm">Element Index</a> |
    <a href="../../supportkey/a.htm">HTML Support History</a></font></td></tr>
</table>
</center>


<br><br>
<dl>
<dt><big><b class="mainheading">What are the Language Attributes?</b></big>
    <dd>These attributes facilitate the rendering of documents that use multiple
        languages or character sets - especially bi-directional language situations.
        <br><br>

        This attribute category draws its inspiration from a
        <a href="../shorthands.htm#param">Parameter Entity</a>
        in HTML 4.x called "%i18n" (short for "internationalization" - 'i',
        followed by 18 letters in between, followed by 'n'.) The HTML 4.x
        category includes only the "dir" and "lang" attributes.
        <br><br>

        The other attribute in the "Language" category on this site (called,
        curiously enough, "language") is IE-specific and indicates the
        scripting language in use for the element. Although this attribute
        deals with a computer language rather than human languages as the other
        two attributes do, the common grouping made sense (to me.)
</dl>

<dl>
<dt><br><big><b class="mainheading">Language Attributes</b></big>

<dt><b class="subheading"><a href="dir.htm">Dir</a></b>
<dt>[<span class="ns">2</span>|<span class="ns">3</span>|<span class="ns">3.2</span>|<b><i class="fs">4</i></b>]
    [<b class="s">X1</b>|<b class="s">X1.1</b>]
    [<b><i class="fs">IE5B2</i></b>|<b class="s">N6</b>|<b class="s">O7.1</b>]
    <dd><b class="l3heading">Required?</b> No
    <dd><b class="l3heading">Description:</b><br>
        This attribute is used to indicate the directionality of the flow of
        the content for the current element. This becomes most helpful in
        bi-directional language scenarios where intrinsic dimension may be
        ambiguous. On block elements, this attribute indicates the base
        directionality of the text in the block. For inline elements this
        attribute starts a new embedding level for direction-dependent content.
        If this attribute is omitted for an inline element, a new embedding
        level is not created.
    <dd><b class="l3heading">Values:</b>
        <b class="alert">ltr</b> | <b class="alert">rtl</b>

<dt><b class="subheading"><a href="lang.htm">Lang</a></b>
<dt>[<span class="ns">2</span>|<b><i class="fs">3</i></b>|<span class="ns">3.2</span>|<b class="s">4</b>] 
    [<b class="s">X1</b>|<b class="s">X1.1</b>]
    [<b><i class="fs">IE4</i></b>|<span class="ns">N</span>|<span class="ns">O</span>]
    <dd><b class="l3heading">Required?</b> No
    <dd><b class="l3heading">Description:</b><br>
        This attribute is used to specify the language of the enclosed content.
        This property can be useful in several ways - it can be used to
        ensure proper display of language-specific character usage (such as
        quotes or decimal points), for speech synthesis, search engine content
        classification or clarification of ambiguous character usage.
        <br><br>

        This attribute takes as its value a string that identifies a language
        system used for communication (with the exception of computer languages.)
        The syntax and registry of HTML language tags is identical to the system
        specified in <a href="http://www.rfc-editor.org/rfc/rfc1766.txt">RFC 1766</a>.
        A language tag is composed of one or more parts: A primary language tag
        and a possibly empty series of subtags:
        <br>
        &#160;&#160;&#160;<b class="alert">language-tag</b>  = [<b class="alert2">Primary
        Language Tag</b>] ("-" [<b class="alert2">Language Subtag</b>])*<br>
        &#160;&#160;&#160;[<b class="alert2">Primary Language Tag</b>]   = "i"
        (for IANA defined languages) | "x" (custom/private use language) | [ISO 639 2-letter
        Language Code]<br>
        &#160;&#160;&#160;[<b class="alert2">Language Subtag</b>] =
        [ISO 3166 2-letter country code] | [dialect or other locale/situation specific
         language]
        <br>
        Language tags are case-insensitive and spaces are not allowed. The
        registering of language tags is administered by the
        Internet Assigned Numbers Authority (<a href="http://www.iana.org">IANA</a>).
        Example language tags include:
        <br>
        &#160;&#160;&#160;<b class="alert">en</b><br>
        &#160;&#160;&#160;<b class="alert">en-US</b><br>
        &#160;&#160;&#160;<b class="alert">x-pig-latin</b>
        <br>
        The LANG attribute overrides any language value specified by any
        parent elements of the current element. If no value is specified at
        any of these levels, the language inheritance mechanism goes up to
        the HTTP protocol header 'Content-Language.' If this is also not
        specified, a default may be determined from the user's browser settings
        or some other criteria.
    <dd><b class="l3heading">Values:</b><br>
        Valid RFC-1766 values representing a hierarchy of language tokens.

<dt><b class="subheading"><a href="language2.htm">Language</a></b>
<dt>[<span class="ns">2</span>|<span class="ns">3</span>|<span class="ns">3.2</span>|<span class="ns">4</span>] 
    [<span class="ns">X1</span>|<span class="ns">X1.1</span>]
    [<b><i class="fs">IE4</i></b>|<span class="ns">N</span>|<span class="ns">O</span>]
    <dd><b class="l3heading">Required?</b> No
    <dd><b class="l3heading">Description:</b><br>
        This attribute is used to specify the current scripting language in use for an
        element. 'JScript' and 'javascript' both refer to Javascript engines. 'Vbs' and
        'Vbscript' both refer to Vbscript engines. 'XML' refers to an embedded XML
        document/fragment. 
    <dd><b class="l3heading">Values:</b><br>
        <b class="alert">JScript</b> [<b class="magicword">DEFAULT</b>] |
        <b class="alert">javascript</b> | <b class="alert">vbs</b> |
        <b class="alert">vbscript</b> | <b class="alert">XML</b>
</dl>

<a name="tips"></a>
<big><b class="mainheading">Tips &amp; Tricks</b></big>
<ul>
    <li><b>NOTE:</b> Support grid information for the LANGUAGE attribute is 
        taken from MS' documentation.
    <li>If DIR=RTL is used on non-bidi content with inline elements, you 
        should probably only observe the punctuation characters swapping 
        ends of the sentence...it doesn't do a lot.
    <li>I have to admit a significant lack of knowledge with Right-to-left rendering 
        issues. I have done the best I can in this area in trying to document what I 
        can discover, but it is like the blind men describing the elephant by 
        feeling only parts of it. Take from that analogy what you will. =)
    <li>I do not know how to adequately test the LANG attribute either (with 
        confidence.) The standards part of the grid was easy, as was "trusting" 
        Microsoft's documentation. Opera's documents state that they do NOT 
        support it, and I am not sure if Netscape 6.x supports this yet.
</ul>

<a name="peculiar"></a>
<big><b class="mainheading">Browser Peculiarities</b></big>
<ul>
    <li>Netscape 6.x renders all DIR="RTL" block content as right-aligned (even
        elements like CENTER.)
    <li>DIR=RTL does nothing on the CAPTION element. Since it has an effect 
        on all other table elements, this just seems like an omission.
    <li>DIR=RTL on the RUBY element crashed my IE6 <em>EVERY</em> time. It
        looks to be dangerous to use this combination. It worked in IE5-5.5.
    <li>DIR=RTL on the LABEL element did bad things in N6.1. Things got better in N6.2.
    <li>DIR=RTL on INPUT TYPE=file is a bad thing in Netscape 6.x. It doesn't like it.
    <li>Text entry in INPUT TYPE=password/text, and TEXTAREA elements is different
        than normal when DIR=RTL is used: new characters typed are entered to the 
        left of the cursor/insertion pointer, not to the right as is typical with 
        western input modes.
    <li>The support listing for HTML 4.x says that DIR is supported on most of 
        the non-visually rendered elements. I don't really understand how this would 
        work, so I have ignored testing that in the browsers. IE's documentation
        states it supports some of these, so they are listed as such on faith. =)
</ul>

<br>
<a href="../../../misc/copyright.htm">Boring Copyright Stuff...</a>
<br>

</BODY>
</HTML>